//
//  MenuViewController.m
//  THiOSWeb
//
//  Created by Dexterlirush on 13-8-29.
//  Copyright (c) 2013年 Dexterlirush. All rights reserved.
//

#import "MenuViewController.h"
#import "HomeViewController.h"

@interface MenuViewController ()

@end

@implementation MenuViewController

@synthesize pageIndex;

- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
    self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
    if (self) {
        // Custom initialization
    }
    return self;
}

- (void)viewDidLoad
{
    [super viewDidLoad];
	// Do any additional setup after loading the view.
    [self showNavigator];
}

- (void)showNavigator
{
    NSString *nameString = [[NSString alloc] init];
    switch (self.pageIndex)
    {
        case 0:
            nameString = @"全部活动";
            break;
        case 10:
            nameString = @"精选活动";
            break;
        case 1:
            nameString = @"课外科技";
            break;
        case 2:
            nameString = @"社会实践";
            break;
        case 3:
            nameString = @"体育活动";
            break;
        case 4:
            nameString = @"志愿公益";
            break;
        case 5:
            nameString = @"文艺活动";
            break;
        case 6:
            nameString = @"讲座论坛";
            break;
        case 7:
            nameString = @"素质拓展";
            break;
        case 8:
            nameString = @"学生社团";
            break;
        case 9:
            nameString = @"党团活动";
            break;
        default:
            nameString = @"新鲜事";
            break;
    }
    [self.navigator setTitle:nameString forState:UIControlStateNormal];
}

- (void)didReceiveMemoryWarning
{
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

- (IBAction)displayNews:(id)sender atIndex:(int)index
{
    self.pageIndex = [sender tag];
}

- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    if ([segue.identifier isEqualToString:@"ShowHomeFromMenuCell"]) {
//        ViewController *destViewController = segue.destinationViewController;
//        destViewController.pageIndex = self.pageIndex;
//        [destViewController showNavigator];
    }
}

@end
